*This do-file executes the files that make predictions and save results for later use
*rszdmspe.do produces DMSPE combination forecasts as in Rapach, Strauss and Zhou (2010)
*rszsimple.do produces mean, median and trimmed mean combination forecasts as in Rapach, Strauss and Zhou (2010)
*ptv*.do does the analysis using already produced individual forecasts with PTV constraints


*Separator for sheet names
global sep="_"

*Data frequencies
local freqs 4 12


*Make one-period ahead forecasts
global h=1
foreach f of local freqs{
	global freq=`f'
	
	global theta=0.9
	do rszdmspe

	global theta=1
	do rszdmspe

	do rszsimple

}

*Make m-month ahead forecasts
local m=6
foreach f of local freqs{

	global freq=`f'
	global h = (`f'/12)*`m'
	
	
	global theta=0.9
	do rszdmspe

	global theta=1
	do rszdmspe

	do rszsimple

}

*Make m-month ahead forecasts
local m=12
foreach f of local freqs{

	global freq=`f'
	global h = (`f'/12)*`m'
	
	
	global theta=0.9
	do rszdmspe

	global theta=1
	do rszdmspe

	do rszsimple

}

*Table 5
global h = 1
foreach f of local freqs{
	global freq=`f'
	
	*Equity premium constraint
	global c="EP"
	global theta=0.9
	do ptvdmspe
	global theta=1
	do ptvdmspe
	do ptvsimple
	*Sharpe Ratio constraint
	global c="SR"
	global theta=0.9
	do ptvdmspe
	global theta=1
	do ptvdmspe
	do ptvsimple

}

*Table 7 
do differences4
*Table 7 for monthly data
do differences12
*Table 8
do properties

end

